﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace UnknowWorld.CardGame
{

    public class SwitchControl : MonoBehaviour
    {

        public CardGameControl cardGameControl;

        private Player _player;

        private Enemey _enemey;

        private bool _loaded;

        void Update()
        {
            if (!_loaded && CardPool.Instance.Loaded && EnemyPool.Instance.Loaded)
            {
                _loaded = true;
                _player = new Player();
                _player.Profession = Profession.Warriop;
                _player.LoadInitCard(() => { });
                _enemey = EnemyPool.Instance.EnemeyByKey("ENEMEY-1");
                _enemey.LoadInitCard();
            }
        }

        public void CardGameStart()
        {
            cardGameControl.GameStart(_player, _enemey);
        }
    }
}